<?php
 $this->headScript()
->prependFile($this->basePath() . '/js/faq_edittor.js')

 ->appendFile($this->basePath() . '/js/tinymce/tinymce.min.js')
 ->appendFile($this->basePath() . '/js/tinymce/jquery.tinymce.min.js');
    $action='create';
?>
<script type="text/javascript">
$(document).ready(function(){

	setTinyEdittor();

	$(".simplemodal-close").click(function(){

		bootbox.confirm("Có chắc chắn muốn không lưu?",function(result){
if(result){
	var backurl=$("#vn3d-back").attr("href");
	location.href=backurl;
}

			});
		});
});



</script>
<style>
#price{
	width: 300px;
}
</style>
<ol class="breadcrumb">
			<li><a id="vn3d-back" href="/admin/product/index/<?php echo $groupProductID;?>">Nhóm sản phẩm</a></li>
			<li class="active">Sản phẩm</li>
</ol>
<div class="col-sm-14">
				<div class="panel panel-primary">
					<div class="panel-heading">
						<h3 class="panel-title">Thêm sản phẩm</h3>
					</div>
					<div class="panel-body">
					   <div class="row">
  <div class="col-lg-14">
<?php
$form = $this->form;
$form->setAttribute('action', $this->url('product', array('action' => "add","id"=>$groupProductID)));
$form->setAttribute('class','navbar-form');
$form->prepare();
// $form->prepare();
echo $this->form()->openTag($form);
?>
<div class="control-group">
    <label>Tên sản phẩm</label>
	<div class="controls">
		<?php echo $this->formRow($form->get('name'));?>
	</div>
</div>
<div class="control-group">
<label>Tóm tắt</label>
	<div class="controls">
		<?php echo $this->formRow($form->get('short_desc'));?>
	</div>
</div>
<div class="control-group">
<label>Mô tả sản phẩm</label>
	<div class="controls">
		<?php echo $this->formRow($form->get('desc'));?>
	</div>
</div>
<div class="control-group">
<label>Giá</label>
	<div class="controls">
		<?php echo $this->formRow($form->get('price'));?><span>&nbsp;&nbsp;$</span>
	</div>
</div>
<div class="control-group">
<label>Mã sản phẩm</label>
	<div class="controls" style="width: 350px;">
		<?php echo $this->formRow($form->get('code'));?>
	</div>
</div>
<div class="control-group">
<label>File bán sản phẩm</label>
	<div class="controls" style="width: 350px;">
		<?php
		$product_file= $form->get('product_file');
		$product_file->setAttributes(array("required" => "required"));
		echo $this->formRow($product_file);

		?>
	</div>
</div>
<div class="control-group">
<label>Video(link nhúng từ Youtube)</label>
	<div class="controls" style="width: 350px;">
		<?php echo $this->formRow($form->get('video'));?>
	</div>
</div>
<div class="control-group">
<label>Banner sản phẩm</label>
	<div class="controls" style="width: 350px;">
		<?php
		$banner= $form->get('banner');
		$banner->setAttributes(array("required" => "required"));
		echo $this->formRow($banner);
		?>
	</div>
</div>
<div class="control-group">
<label>Ảnh mô tả sản phẩm</label>
	<div class="controls" style="width: 350px;">
		<?php
		echo $this->formRow($form->get('image'));
		?>
	</div>
</div>

<div class="control-group">
<br>
<div class="controls">
	<input type="submit" class="btn btn-primary" id="submit"
		value="Submit" /> <input type="button" class="btn simplemodal-close"
		data-dismiss="modal" value="Cancel" id="cancel"/>
</div></div>
<?php echo $this->form()->closeTag();
?>
</div>